package com.sise.netty.reactor模型.多Reactor模型.demo;

import lombok.extern.slf4j.Slf4j;

import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;

/**
 * @author idea
 * @data 2019/4/11
 */
@Slf4j
public class Client {

    public static void main(String[] args) {
        try {
            SocketChannel socketChannel = SocketChannel.open();
            socketChannel.connect(new InetSocketAddress(InetAddress.getLocalHost(), 1234));
            socketChannel.configureBlocking(false);
            socketChannel.write(ByteBuffer.wrap("this is idea test".getBytes()));
            System.out.println("发送结束");
            Thread.sleep(50000);
        } catch (Exception e) {
            log.error("[server]异常出现，信息为{}", e);
        }
    }
}
